/*
 * Copyright (c) 2012 Masahiro Kozuka. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/* {D7FCC736-872F-4F2C-9044-3E6F6D48C344} */
#define USRSCTP_PROVIDER_GUID_INIT \
	{ 0xd7fcc736, 0x872f, 0x4f2c, \
		{ 0x90, 0x44, 0x3e, 0x6f, 0x6d, 0x48, 0xc3, 0x44 } \
	}

#define USRSCTP_SERVICE_PROVIDER_PATH	L"%SystemRoot%\\System32\\usrsctp_sp.dll"

#define IPPROTO_SCTP			132

GUID UsrsctpProviderGuid = USRSCTP_PROVIDER_GUID_INIT;


WSAPROTOCOL_INFOW UsrsctpProtocolInfos[] = {
	// one-to-one socket for SCTP/IPv4 with UDP encap
{
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_GRACEFUL_CLOSE |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	0,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET,
	sizeof(SOCKADDR_IN),
	sizeof(SOCKADDR_IN),
	SOCK_STREAM,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-one) [SCTP/IPv4 with UDP encap]"
},
{
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_GRACEFUL_CLOSE |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	1,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET6,
	sizeof(SOCKADDR_IN6),
	sizeof(SOCKADDR_IN6),
	SOCK_STREAM,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-one) [SCTP/IPv6 with UDP encap]"
},
{
	XP1_CONNECTIONLESS |
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	2,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET,
	sizeof(SOCKADDR_IN),
	sizeof(SOCKADDR_IN),
	SOCK_SEQPACKET,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-many) [SCTP/IPv4 with UDP encap]"
},
{
	XP1_CONNECTIONLESS |
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	3,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET6,
	sizeof(SOCKADDR_IN6),
	sizeof(SOCKADDR_IN6),
	SOCK_SEQPACKET,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-many) [SCTP/IPv6 with UDP encap]"
},
{
	XP1_CONNECTIONLESS |
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	4,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET,
	sizeof(SOCKADDR_IN),
	sizeof(SOCKADDR_IN),
	SOCK_DGRAM,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-many) [SCTP/IPv4 with UDP encap]"
},
{
	XP1_CONNECTIONLESS |
	XP1_GUARANTEED_DELIVERY |
	XP1_GUARANTEED_ORDER |
	XP1_MESSAGE_ORIENTED,
	0,
	0,
	0,
	0,
	USRSCTP_PROVIDER_GUID_INIT,
	5,
	{
		BASE_PROTOCOL,
		{0, 0, 0, 0, 0, 0, 0}
	},
	0,
	AF_INET6,
	sizeof(SOCKADDR_IN6),
	sizeof(SOCKADDR_IN6),
	SOCK_DGRAM,
	IPPROTO_SCTP,
	0,
	BIGENDIAN,
	SECURITY_PROTOCOL_NONE,
	0xFFFFFFFF,
	0,
	L"Sctp(one-to-many) [SCTP/IPv6 with UDP encap]"
},
};

#define NUM_USRSCTP_PROTOCOL_INFOS \
	(sizeof(UsrsctpProtocolInfos) / sizeof(UsrsctpProtocolInfos[0]))